home *** CD-ROM | disk | FTP | other *** search
/ Trading on the Edge / Trading On The Edge - CD-ROM Toolkit (Wayzata Technology)(2031)(1994).bin / pc / mac_file / vendor_d / neuralwa / nw2v50 / host.h < prev    next >
Text File  |  1993-08-23  |  29KB  |  1,283 lines

  1. /* host.h - Variations between host machines/compilers defined here. */
  2.  
  3. /************************************************************************
  4.  * Copyright(C) 1987-1992 NeuralWare Inc                                *
  5.  * Penn Center West, IV-227, Pittsburgh, PA 15276                       *
  6.  * Telephone: (412) 787-8222    FAX: (412) 787-8220                     *
  7.  *                                                                      *
  8.  * All rights reserved.  No part of this program may be reproduced,     *
  9.  * stored in a retrieval system, or transmitted, in any form or by any  *
  10.  * means, electronic, mechanical, photocopying, recording or otherwise  *
  11.  * without the prior written permission of the copyright owner,         *
  12.  * NeuralWare, Inc.                                                     *
  13.  *                                                                      *
  14.  *                          PROPRIETARY NOTICE                          *
  15.  *                                                                      *
  16.  * This document is the property of NeuralWare, Inc. and contains       *
  17.  * trade-secrets and other proprietary information.  The information    *
  18.  * herein is reserved as proprietary to NeuralWare, and is not to be    *
  19.  * published, reproduced, copied, disclosed, used, or reverse           *
  20.  * engineered without the express written consent of a duly authorized  *
  21.  * representative of NeuralWare.                                        *
  22.  ************************************************************************
  23.  */
  24.  
  25. /* TM : 06-Sep-90:  pull together all information into single file */
  26. /* AWP, TM - add platform detection, more generic #ifdefs */
  27.  
  28. /* I find it curious that INT is defined in only one case - the IBP model */
  29.  
  30. #ifndef HOST_H
  31. #define HOST_H  1
  32.  
  33. /*
  34.  * -----------------------------------------------------------------------
  35.  * SEC 1. MAP SOFTWARE/PLATFORM #IFDEFS ONTO SPECIFIC MACHINE TYPES
  36.  * -----------------------------------------------------------------------
  37.  */
  38.  
  39. #define MULTIPLAT  **error** -- multiple definitions for this platform
  40.  
  41. #if defined(_CRAY) && defined(_UNICOS)
  42. /* --------------- CRAY ( psc ) --------------- */
  43. #ifdef platform
  44. MULTIPLAT
  45. #endif
  46. #define platform
  47. #ifndef CRAY
  48. #define CRAY 1
  49. #endif
  50. #endif
  51.  
  52. #if defined(mips) && defined(nec) && defined(nec_e48m220) && defined(nec_ews) && defined(nec_ews_risc1) && defined(nec_ews_svr4) && defined(r3000) && defined(unix)
  53. /* --------------- NEC/EWS ( amygdala ) --------------- */
  54. #ifdef platform
  55. MULTIPLAT
  56. #endif
  57. #define platform
  58. #ifndef EWS
  59. #define EWS 1
  60. #endif
  61. #endif
  62.  
  63. #if defined(__hpux) && defined(__unix)
  64. /* --------------- HP700 ( bourbon ) --------------- */
  65. #ifdef platform
  66. MULTIPLAT
  67. #endif
  68. #define platform
  69. #ifndef HP700
  70. #define HP700 1
  71. #endif
  72. #endif
  73.  
  74. #if defined(__sgi) && defined(__mips) && defined(__host_mips) && defined(__unix)
  75. /* --------------- IRIS/INDIGIO ( xyzzy ) --------------- */
  76. #ifdef platform
  77. MULTIPLAT
  78. #endif
  79. #define platform
  80. #ifndef IRIS
  81. #define IRIS 1
  82. #endif
  83. #endif
  84.  
  85. #if defined(bsd4_2) && defined(ultrix) && defined(unix) && defined(vax)
  86. /* --------------- VAX/ULTRIX ( rhemi ) --------------- */
  87. #ifdef platform
  88. MULTIPLAT
  89. #endif
  90. #define platform
  91. #ifndef VAXULT
  92. #define VAXULT 1
  93. #endif
  94. #endif
  95.  
  96. #if defined(vax) && defined(vax11c) && defined(vms)
  97. /* --------------- Vax/VMS ( lhemi ) --------------- */
  98. #ifdef platform
  99. MULTIPLAT
  100. #endif
  101. #define platform
  102. #ifndef VMS
  103. #define VMS 1
  104. #define VAXC   /* VAX-C compiler: true for the VMS under which NWII is built */
  105. #endif
  106. #endif
  107.  
  108. #if defined(sparc) && defined(sun) && defined(unix)
  109. /* --------------- SUN4 ( lobe ) or SOLARIS (pons) --------------- */
  110. /* oddly enough, while the cc defines sun4 in this case, 
  111.    cpp does not. */
  112. #ifdef platform
  113. MULTIPLAT
  114. #endif
  115. #define platform
  116. #ifdef __STDC__
  117. #ifndef SOLARIS
  118. #define SOLARIS 1
  119. #endif
  120. #else
  121. #ifndef SUN4
  122. #define SUN4 1
  123. #endif
  124. #endif
  125. #endif
  126.  
  127. #if defined(mc68000) && defined(mc68020) && defined(sun) && defined(sun3) && defined(unix)
  128. /* --------------- SUN3 ( dendrite ) --------------- */
  129. #ifdef platform
  130. MULTIPLAT
  131. #endif
  132. #define platform
  133. #ifndef SUN3
  134. #define SUN3 1
  135. #endif
  136. #endif
  137.  
  138. #if defined(i386) && defined(sun) && defined(sun386) && defined(unix)
  139. /* --------------- SUN386 ( my386 ) --------------- */
  140. #ifdef platform
  141. MULTIPLAT
  142. #endif
  143. #define platform
  144. #ifndef SUN386
  145. #define SUN386 1
  146. #endif
  147. #endif
  148.  
  149. #if defined(i386) && !defined(sun) && defined(unix)
  150. /* --------------- PS2AIX (psyche ) --------------- */
  151. #ifdef platform
  152. MULTIPLAT
  153. #endif
  154. #define platform
  155. #ifndef PS2AIX
  156. #define PS2AIX 1
  157. #endif
  158. #endif
  159.  
  160. #if defined(SUN3) || defined (SUN386) || defined (SUN4)
  161. /* force SUN definition */
  162. #define SUN 1
  163. #endif
  164.  
  165. /*
  166.  * -----------------------------------------------------------------------
  167.  * SEC 2. Set up defaults
  168.  * -----------------------------------------------------------------------
  169.  */
  170.  
  171. /* undef INT_EQ_SHORT, INT_EQ_LONG by default; 
  172.    one must be defined, depending upon the compiler */
  173.  
  174. #undef  INT_EQ_SHORT
  175. #undef  INT_EQ_LONG
  176.  
  177. /* some compilers do not permit sizeof(int) to be used in a macro; if
  178.    yours does, define SIZEOF_MACRO_OK */
  179.  
  180. #undef SIZEOF_MACRO_OK
  181.  
  182. #if !defined(_STDIO_H)
  183. #include <stdio.h>
  184. #endif
  185. #if defined(SKY) && !defined(fileno)
  186. /* riddle this: SKY's stdio.h will not define fileno unless _K_AND_R
  187.    is set or _MSDOS and __HIGHC__ are set. */
  188. #define fileno(__stream)  ((__stream)->_file) 
  189. #endif
  190. /*
  191.  * -----------------------------------------------------------------------
  192.  * SEC 3. For each "platform" specify ...
  193.  * The following symbols should be defined as 1 if applicable;
  194.  * undefined otherwise
  195.  *
  196.  * PROTOTYPING : supports function prototyping (or tolerates the syntax)
  197.  * ANSI_HEADER : supports new style function header
  198.  *
  199.  * ELLIPSIS : should be defined as "..." or nothing, depending upon
  200.  * what should be in the last argument of a prototype to indicate
  201.  * that the number of args is variable
  202.  
  203.  * IBM_TYPE : this product is being built for some sort of IBM AT
  204.  * variant - possibilities include standard IBM, NEC, and  FUJITSU
  205.  *
  206.  * one of the xxx_KEYS options must be selected, except for X versions
  207.  *
  208.  * IBM_KEYS 
  209.  * NEC_KEYS
  210.  * FUJITSU_KEYS
  211.  * SUN_KEYS
  212.  * -----------------------------------------------------------------------
  213.  */
  214. /* */
  215. #if (!defined(HOST_IS) && defined(__ZTC__))
  216. #define HOST_IS "IBM AT,MS-DOS,ZORTECH C"
  217. #define IBM_TYPE 1
  218. #define MSDOS 1   /* operating system (predefined by  */
  219.         /* Zortech preprocessor)    */
  220. #ifndef DLC
  221. #define DLC 1   /* compiler - for historical reasons */
  222. #endif
  223.  
  224. #define PROTOTYPING 1 /* compiler supports function prototyping */
  225. #define ANSI_HEADER 1
  226. #define ELLIPSIS  ...
  227.  
  228. #define INT_EQ_SHORT  1
  229. #define SIZEOF_MACRO_OK 1
  230.  
  231. #endif /* __ZTC */
  232. /* */
  233. #if (!defined(HOST_IS) && defined(__TURBOC__))
  234. #define HOST_IS "IBM AT,MS-DOS,TURBO C"
  235. #define IBM_TYPE 1
  236. #define MSDOS 1   /* operating system (predefined by  */
  237.         /* Zortech preprocessor)    */
  238.  
  239. #define PROTOTYPING 1 /* compiler supports function prototyping */
  240. #define ANSI_HEADER 1
  241. #define ELLIPSIS  ...
  242.  
  243. #define INT_EQ_SHORT  1
  244. #define SIZEOF_MACRO_OK 1
  245.  
  246. #endif /* __TURBOC__ */
  247. /* */
  248.  
  249. /* M_I86 and MSDOS are predefined by Microsoft C compiler */
  250.  
  251. #if (!defined(HOST_IS) && defined(M_I86))
  252. #define HOST_IS "IBM 80x86,MS-DOS,MSC 6.0"
  253.  
  254. #define IBM_TYPE  1
  255. /* changed MSC version from 6 to 7; 4-28-93 mjs */
  256. #define MSC   7     /* set MSC to the version */
  257.  
  258. /* added for ergo realloc() bug; 5-27-93 mjs */
  259. #ifdef PM2
  260. #ifndef DOSX286
  261. #define malloc(a)       ergo_malloc(a)
  262. #define calloc(a,b)     ergo_calloc(a,b)
  263. #define realloc(a,b)    ergo_realloc(a,b)
  264. #define free(a)         ergo_free(a)
  265. void *ergo_malloc(unsigned);
  266. void *ergo_calloc(unsigned,unsigned);
  267. void *ergo_realloc(void *,unsigned);
  268. void ergo_free(void *);
  269. #endif
  270. #endif
  271.  
  272. /* debugging macros - appends debug lines to a file on a PC-NFS mounted
  273.  * drive so the file can be viewed with a "tail -f" on UNIX
  274.  */
  275. #define DMP1(a) {FILE *F; fprintf(F=fopen("q:\\d","a"),a);fclose(F);}
  276. #define DMP2(a,b) {FILE *F; fprintf(F=fopen("q:\\d","a"),a,b);fclose(F);}
  277. #define DMP3(a,b,c) {FILE *F; fprintf(F=fopen("q:\\d","a"),a,b,c);fclose(F);}
  278. #define DMP4(a,b,c,d) {FILE *F; fprintf(F=fopen("q:\\d","a"),a,b,c,d);fclose(F);}
  279.  
  280. #define PROTOTYPING 1 /* compiler supports function prototyping */
  281.  
  282. #define ANSI_HEADER 1
  283. #define ELLIPSIS  ...
  284.  
  285. #define INT_EQ_SHORT  1
  286.  
  287. #endif /* M_I86 */
  288.  
  289. /* */
  290. /* IBM AT, MS-DOS, Turbo C */
  291. #if (!defined(HOST_IS) && defined(__TURBOC__))
  292. #define HOST_IS "IBM AT,MS-DOS,TURBO C"
  293. #define IBM_TYPE  1
  294. #define MSDOS 1   /* operating system     */
  295.  
  296. #define PROTOTYPING 1 /* compiler supports function prototyping */
  297. #define ANSI_HEADER 1
  298. #define ELLIPSIS  ...
  299.  
  300. #define INT_EQ_SHORT  1
  301. #define SIZEOF_MACRO_OK 1
  302.  
  303. /* Default 0 pointer type */
  304. #ifndef NULL
  305. #if LPTR
  306. #define NULL  (0L)
  307. #else
  308. #define NULL  0
  309. #endif
  310. #endif
  311.  
  312. #endif /* __TURBOC__ */
  313.  
  314. /* */
  315. #if defined(IBP)  /* { */
  316.  
  317. #if _MSC_VER == 800    /* MS-Windows NT C compiler { */
  318. #define __MSNT__
  319. #define HOST_IS "IBM 386,MS-DOS,MS-NT C"
  320. #define IBM 1
  321. #define IBM_TYPE 1
  322. #define PM32 1
  323. #define MSDOS 1
  324. #define INT_EQ_LONG   1
  325. #define stdprn    stderr
  326.  
  327. #else /* _MSC_VER }{*/
  328.  
  329. #include <stdarg.h>
  330. /* This must come after the __ZTC__, */
  331.  
  332. #define assert(e) ((e) || (_assert("e",__FILE__,__LINE__),1))
  333.  
  334. /*  Added for NDP V4.2.1 -jsb */
  335. #define _assert _Assert
  336.  
  337. extern void _assert(char *, char *, unsigned);
  338.  
  339. /*  See if MicroWay fixed the CR/LF problem -jsb
  340. **
  341. **  #define fprintf ndp_fprintf
  342. **  #define vfprintf ndp_vfprintf
  343. **  #define fputs ndp_fputs
  344. **  #define fputc ndp_fputc
  345. **  int ndp_vfprintf(FILE *stream, const char *format, va_list arg);
  346. **  int ndp_fprintf(FILE *stream, const char *format, ...);
  347. **  int ndp_fputs(const char *s, FILE *stream);
  348. **  int ndp_fputc(int c, FILE *stream);
  349. */
  350.  
  351. #ifndef M_I86
  352. #ifndef __TURBOC__
  353. #ifndef __ZTC__   /* this stuff runs under protected mode */
  354. #define HOST_IS "IBM 386,MS-DOS,NDP C"
  355. #define IBM_TYPE  1
  356.  
  357. #ifndef IBM
  358. #define IBM     1
  359. #endif
  360.  
  361. #ifndef MSDOS
  362. #define MSDOS 1 /* operating system  - defined as arg to make */
  363. #endif
  364.  
  365. #define NDP 1 /* compiler   */
  366.  
  367. #define stdprn    stderr
  368.  
  369. #define PROTOTYPING 1
  370. #define ANSI_HEADER 1
  371. #define ELLIPSIS  ...
  372.  
  373. #define INT_EQ_LONG   1
  374.  
  375. /* Default 0 pointer type */
  376. #ifndef NULL
  377. #define NULL  (0L)
  378. #endif
  379.  
  380. /* Unsupported type syntax */
  381. #define signed
  382. #define volatile
  383. #define far
  384.  
  385. #else /* __ZTC__ */
  386. #define SERVER    1
  387. #endif /* __ZTC__ */
  388. #else /* __TURBOC__ */
  389. #define SERVER    1
  390. #endif /* __TURBOC__ */
  391. #else /* M_I86 */
  392. #define SERVER    1
  393. #endif /* M_I86 */
  394. #endif /* _MSC_VER } */
  395. #endif /* } IBP */
  396.  
  397. /* */
  398. /* The I860 set may be called when HOST_IS has already been defined */
  399. /* This must come after the M_I86 stuff */
  400. #if defined(M860) || defined(A860) || defined(W860)
  401. #define TWO_MACHINE_MODEL   1
  402. #define I860     1
  403. #ifndef M_I86
  404. #define WORKER   1
  405. #ifdef M860
  406. #define HOST_IS "I860, MS-DOS, GreenHills C"
  407. #else
  408. #ifdef A860
  409. #define HOST_IS "I860, MS-DOS, MetaWare C"
  410. #define assert(e) ((e) || (_assert("e",__FILE__,__LINE__),1))
  411. extern void _assert(char *, char *, unsigned);
  412. #else
  413. /* W860 */
  414. #define HOST_IS "I860, MS-DOS, ???????? C"
  415. #endif
  416. #endif
  417. #define IBM_TYPE  1
  418.  
  419. #ifndef IBM
  420. #define IBM     1
  421. #endif
  422.  
  423. #ifndef MSDOS
  424. #define MSDOS 1 /* operating system  - defined as arg to make */
  425. #endif
  426.  
  427. #define stdprn    stderr
  428. #define NDP 1 /* compiler   */
  429.  
  430. #define PROTOTYPING 1
  431. #define ANSI_HEADER 1
  432. #define ELLIPSIS  ...
  433.  
  434. #define INT_EQ_LONG   1
  435.  
  436. /* Default 0 pointer type */
  437. #ifndef NULL
  438. #define NULL  (0L)
  439. #endif
  440.  
  441. /* Unsupported type syntax */
  442. #define signed
  443. #define volatile
  444. #define far
  445.  
  446. #else /* M_I86 */
  447. #define SERVER    1
  448. #endif /* M_I86 */
  449. #endif /* I860 set */
  450.  
  451. /* */
  452. #if (!defined(HOST_IS) && defined(NEXT))
  453. #define HOST_IS "NeXT, Mach, GNU C"
  454.  
  455. /* machine:   Symbol NeXT   is defined by GNU C compiler  */
  456. /* operating system:  Symbol __MACH__ is defined by GNU C compiler  */
  457. /* compiler:    Symbol __GNUC__ is defined when compiling ".c", */
  458. /*      ".s", or ".m" files       */
  459. /*      Symbol __OBJC__ is defined when compiling   */
  460. /*      Objective C ".m" files      */
  461.  
  462. #ifndef NEXTSTD_H
  463. #include "appkit/nextstd.h"
  464.         /* brings in math.h, stdio.h, and others */
  465.         /* nextstd.h is included by appkit.h if */
  466.         /* NEXTSTD_H is not defined */
  467. #endif
  468.  
  469. #define UNIX 1
  470.  
  471. #define PROTOTYPING 1 /* GNU C compiler supports prototyping */
  472. #define ANSI_HEADER 1
  473. #define ELLIPSIS
  474.  
  475. #define INT_EQ_LONG 1
  476.  
  477. /* Default 0 pointer type */
  478. #ifndef NULL
  479. #define NULL  (0)
  480. #endif
  481.  
  482. typedef void *windowhandle_t; /* whenever used should be cast to id !! */
  483.  
  484. typedef struct
  485. {
  486.   float red;
  487.   float green;
  488.   float blue;
  489. }RGBColor;      /* define an RGB color structure */
  490.  
  491. #endif /* NEXT */
  492. /* */
  493. #if (!defined(HOST_IS) && defined(RS6))
  494. #define HOST_IS "RS-6000,AIX"
  495.  
  496. #ifndef AIXOS
  497. #define AIXOS   1 /* AIX operating system */
  498. #endif
  499. #define UNIX 1
  500. #define DGXWIN    1 /* X-windows environment */
  501.  
  502. #define PROTOTYPING 1
  503. #define ANSI_HEADER 1
  504. #define ELLIPSIS  ...
  505.  
  506. #define INT_EQ_LONG 1
  507.  
  508. #undef signed   /* chars are unsigned */
  509. #define const
  510. #define volatile
  511. #define cdecl
  512. #ifndef _POSIX_SOURCE
  513. typedef char * caddr_t;        /* RS6000 defines caddr_t only
  514.                                    for POSIX_SOURCE */
  515. #endif /* not _POSIX_SOURCE */
  516. #endif /* RS6 */
  517. /* */
  518. #if (!defined(HOST_IS) && defined(PS2AIX))
  519. #define HOST_IS "PS/2,AIX"
  520.  
  521. #ifndef AIXOS
  522. #define AIXOS   1 /* AIX operating system */
  523. #endif
  524. #define UNIX 1
  525. #define DGXWIN    1 /* X-windows environment */
  526.  
  527. #define PROTOTYPING 1
  528. #define ANSI_HEADER 1
  529. #define ELLIPSIS  ...
  530.  
  531. #define INT_EQ_LONG 1
  532.  
  533. #undef signed   /* chars are unsigned */
  534. #define const
  535. #define volatile
  536. #define cdecl
  537.  
  538. #endif /* PS2AIX */
  539. /* */
  540. #if (!defined(HOST_IS) && defined(VAXULT))
  541. #define HOST_IS    "VAX,ULTRIX"
  542.  
  543. #ifndef    ULTRIX
  544. #define    ULTRIX 1        /* DEC Ultrix operating system */
  545. #endif
  546. #define UNIX 1
  547. #define    DGXWIN        1    /* X-windows environment */
  548.  
  549. #undef ANSI_HEADER
  550. #undef PROTOTYPING
  551. #define    ELLIPSIS    ...
  552.  
  553. #define INT_EQ_LONG 1
  554.  
  555. #endif /* VAXULT */
  556.  
  557. /* */
  558.  
  559. #if (!defined(HOST_IS) && defined(VMS))
  560. #define HOST_IS    "VAX,VMS"
  561.  
  562. #ifndef    VAXC
  563. #define    VAXC 1        /* VAXC: VMS simulated DEC Ultrix operating system */
  564. #endif
  565. #define UNIX 1
  566. #define    DGXWIN        1    /* X-windows environment */
  567.  
  568. #undef ANSI_HEADER
  569. #undef PROTOTYPING
  570. #define    ELLIPSIS    ...
  571.  
  572. #define INT_EQ_LONG 1
  573.  
  574. #define getcwd vms_getcwd
  575. /* #define fgets  vms_fgets */    /* out for now  XXX --AWP 20-Jan-92 */
  576.  
  577. #endif /* VMS */
  578.  
  579. #if (!defined(HOST_IS) && defined(EWS))
  580. #define HOST_IS "EWS/SVR4"
  581.  
  582. #ifndef SYSV
  583. #define SYSV 1                /* System 5 */
  584. #endif
  585.  
  586. #ifndef SVR4
  587. #define SVR4 1                /* System 5 release 4 */
  588. #endif
  589.  
  590. #define UNIX 1
  591.  
  592. #define DGXWIN          1       /* X-windows environment */
  593.  
  594. #undef  PROTOTYPING
  595. #undef  ANSI_HEADER
  596.  
  597. #define ELLIPSIS        ...
  598.  
  599. #define INT_EQ_LONG 1
  600.  
  601. #undef signed           /* chars are unsigned   */
  602. #define const
  603. #define volatile
  604. #define cdecl
  605.  
  606. #endif /* EWS */
  607.  
  608. #if (!defined(HOST_IS) && defined(HP700))
  609. #define HOST_IS "HP700"
  610. #ifndef SYSV
  611. #define SYSV 1                /* System 5 */
  612. #endif
  613.  
  614. #if 0
  615. #ifndef SVR4
  616. #define SVR4 1                /* System 5 release 4 */
  617. #endif
  618. #endif
  619.  
  620. #define UNIX 1
  621.  
  622. #define DGXWIN          1       /* X-windows environment */
  623.  
  624. #define PROTOTYPING     1
  625. #define ANSI_HEADER     1
  626.  
  627. #define ELLIPSIS        ...
  628.  
  629. #define INT_EQ_LONG 1
  630. #define SIZEOF_MACRO_OK 1
  631.  
  632. #undef signed           /* chars are unsigned   */
  633. #define const
  634. #undef  volatile
  635. #define cdecl
  636. #define far 
  637. #endif /* HP700 */
  638.  
  639. #if (!defined(HOST_IS) && defined(IRIS))
  640. #define HOST_IS "IRIS/SVR4"
  641.  
  642. #ifndef SYSV
  643. #define SYSV 1                /* System 5 */
  644. #endif
  645.  
  646. #ifndef SVR4
  647. #define SVR4 1                /* System 5 release 4 */
  648. #endif
  649.  
  650. #define UNIX 1
  651.  
  652. #define DGXWIN          1       /* X-windows environment */
  653.  
  654. #undef  PROTOTYPING
  655. #undef  ANSI_HEADER
  656.  
  657. #define ELLIPSIS        ...
  658.  
  659. #define INT_EQ_LONG 1
  660.  
  661. #undef signed           /* chars are unsigned   */
  662. #define volatile
  663. #define cdecl
  664.  
  665. #endif /* IRIS */
  666.  
  667. /* */
  668. #if (!defined(HOST_IS) && defined(CRAY))
  669. #define HOST_IS "CRAY/UNICOS"
  670.  
  671. #ifndef UNICOS
  672. #define UNICOS 1
  673. #endif
  674.  
  675. #define UNIX 1
  676.  
  677. #define DGXWIN          1       /* X-windows environment */
  678.  
  679. #undef  PROTOTYPING
  680. #undef  ANSI_HEADER     1
  681.  
  682. #define ELLIPSIS        ...
  683.  
  684. /* Actually, an INT  is 64 bit */
  685. #define INT_EQ_LONG 1
  686.  
  687. #undef signed           /* chars are unsigned   */
  688. #define const
  689. #define volatile
  690. #define cdecl
  691.  
  692. #endif /* CRAY */
  693. /* */
  694. #if (!defined(HOST_IS) && defined(SKY))
  695. #define HOST_IS "SKY/SUN4/SUNOS"
  696.  
  697. #define UNIX 1
  698. #define DGXWIN          1       /* X-windows environment */
  699.  
  700. #define  PROTOTYPING    1
  701. #define  ANSI_HEADER    1
  702. #define ELLIPSIS        ...
  703.  
  704. #define INT_EQ_LONG 1
  705.  
  706. #if 0
  707. #undef signed
  708. #endif
  709. #define const
  710. #define volatile
  711. #define cdecl
  712.  
  713. #endif /* SKY */
  714. /* */
  715. #if (!defined(HOST_IS) && (defined(SUN)))
  716. /*if (!defined(HOST_IS) && (defined(SUN))) */
  717. #define HOST_IS "Sun,BSD Unix,PCC"
  718.  
  719. #define BSDC  1   /* compiler       */
  720.  
  721. #if defined(SUN4SV) || defined(SUN3) || defined(SUN386)
  722. #define SUN_KEYS  1 /* keyboard       */
  723. #define DGSUN   1 /* DG routines for SUN */
  724. typedef char *windowhandle_t;
  725. #else
  726. #define DGXWIN 1
  727. #endif
  728. #define UNIX    1 /* UNIX operating system for special things */
  729.  
  730. #ifndef SUNOS_3
  731. #ifndef SUNOS_4
  732. #define SUNOS_4   1 /* default to SUN OS/4 */
  733. #endif
  734. #endif
  735.  
  736. #if defined(__TRANSPUTER__) || defined(__STDC__)
  737. #define PROTOTYPING 1
  738. #define ANSI_HEADER 1
  739. #define ELLIPSIS ...
  740. #else
  741. #undef PROTOTYPING
  742. #undef ANSI_HEADER
  743. #define ELLIPSIS
  744. #define void int  /* Unix C doesn't handle void right */
  745. #endif
  746.  
  747. #define INT_EQ_LONG 1   /* is this true for all SUNs? */
  748.  
  749. #define signed    /* chars are signed */
  750. #define const
  751. #define volatile
  752.  
  753. /* Default 0 pointer type */
  754. #ifndef NULL
  755. #define NULL  0
  756. #endif
  757.  
  758. /* BSD still erroneously uses index() and rindex()  */
  759. #define strchr  index
  760. #define strrchr rindex
  761.  
  762. #endif /* SUN */
  763. /* */
  764. #if (!defined(HOST_IS) && (defined(SOLARIS)))
  765.  
  766. #define HOST_IS "Sun,SVR4"
  767.  
  768. #ifndef SYSV
  769. #define SYSV 1                /* System 5 */
  770. #endif
  771.  
  772. #ifndef SVR4
  773. #define SVR4 1                /* System 5 release 4 */
  774. #endif
  775.  
  776. #define DGXWIN 1
  777. #define UNIX   1 /* UNIX operating system for special things */
  778.  
  779. #define SUNOS_5   1
  780.  
  781. #define PROTOTYPING 1
  782. #define ANSI_HEADER 1
  783. #define ELLIPSIS ...
  784.  
  785. #define INT_EQ_LONG 1
  786.  
  787. /* Default 0 pointer type */
  788. #ifndef NULL
  789. #define NULL  0
  790. #endif
  791.  
  792. #endif /* SOLARIS */
  793. /* */
  794. #if (!defined(HOST_IS) && (defined(MEIKO)))
  795.  
  796. #define HOST_IS "MEIKO,Sun host"
  797.  
  798. #define BSDC  1   /* compiler       */
  799.  
  800. #define DGXWIN 1
  801.  
  802. #define UNIX    1 /* UNIX operating system for special things */
  803.  
  804. #define PROTOTYPING 1
  805. #define ANSI_HEADER 1
  806. #define ELLIPSIS ...
  807.  
  808. #define INT_EQ_LONG 1
  809.  
  810. #define signed    /* chars are signed */
  811. #define const
  812. #define volatile
  813.  
  814. /* BSD still erroneously uses index() and rindex()  */
  815. #define strchr  index
  816. #define strrchr rindex
  817.  
  818. #endif /* MEIKO */
  819. /* */
  820. #if !defined(HOST_IS) && defined(XTM)
  821. #undef XTM
  822. #define XTM 1   /* machine        */
  823. #define UNIX  1   /* a misnomer on the XTM    */
  824. #define IBM_KEYS 1
  825.  
  826. #define HOST_IS "XTM, QIX"
  827.  
  828. #ifndef nw2pt /* is this correct ? should be in n2host.h, I think. */
  829. #define TRANS 1
  830. #endif
  831.  
  832. #define PROTOTYPING 1
  833. #define ANSI_HEADER 1
  834. #define ELLIPSIS ...
  835.  
  836. #define DGXTM 1
  837.  
  838. #define INT_EQ_LONG 1
  839.  
  840. /* Default 0 pointer type */
  841. #ifndef NULL
  842. #define NULL  0
  843. #endif
  844.  
  845. /* For windowing systems, we need a handle type for windows */
  846.  
  847. typedef char *windowhandle_t;
  848.  
  849. #endif /* XTM */
  850.  
  851. /* */
  852. #if !defined(HOST_IS) && (defined(MAC) || defined(THINK_C))
  853. #define HOST_IS "Apple Macintosh"
  854.  
  855. #ifndef MAC
  856. #define MAC 1
  857. #endif
  858.  
  859. #define MACOS   1
  860. #define DGMAC   1
  861.  
  862. #define ANSI_HEADER 1
  863. #if defined(MPW3) || defined(THINK_C)
  864. #define PROTOTYPING 1
  865. #define ELLIPSIS  ...
  866. #else
  867. #undef PROTOTYPING
  868. #define ELLIPSIS
  869. #endif  /* mpw3 */
  870.  
  871. #define signed    /* chars are signed */
  872. #define const
  873. #define volatile
  874.  
  875. #define INT_EQ_LONG 1
  876.  
  877. /* Default 0 pointer type */
  878. #ifndef NULL
  879. #define NULL  0L
  880. #endif
  881. #endif /* MAC */
  882.  
  883. /* */
  884. #ifndef HOST_IS
  885.   error! error! error!
  886. #endif
  887.  
  888. /*
  889.  * -----------------------------------------------------------------------
  890.  * SEC 4. Universal definitions which apply to everybody 
  891.  * -----------------------------------------------------------------------
  892.  */
  893.  
  894. #ifdef PROTOTYPING
  895. #define ARGLIST(a) a
  896. #define ARGS(a) a
  897. #define _A0 void
  898. #else
  899. #define ARGLIST(a) ()
  900. #define ARGS(a) ()
  901. #define _A0
  902. #endif
  903.  
  904. #define BITSPERBYTE 8
  905.  
  906. typedef long           SL;   /* signed long */
  907. #define xdr_sl    xdr_long
  908.  
  909. typedef unsigned long  UL;   /* unsigned long */
  910. #define xdr_ul    xdr_u_long
  911.  
  912. typedef short          SW;   /* signed word */
  913. #define xdr_sw    xdr_short
  914.  
  915. typedef unsigned short UW;   /* unsigned word */
  916. #define xdr_uw    xdr_u_short
  917.  
  918. typedef char           XB;   /* unknown byte type */
  919. #define xdr_xb    xdr_char
  920.  
  921. typedef unsigned char  UB;   /* unsigned byte */
  922. #define xdr_ub    xdr_u_char
  923.  
  924. typedef int            NINT;   /* native integer */
  925. #define xdr_nint  xdr_int
  926.  
  927. typedef unsigned int   UNINT;    /* unsigned native integer */
  928.  
  929. typedef double         REAL;   /* floating point number */
  930. #define xdr_real  xdr_double
  931.  
  932. typedef float          SREAL;    /* short real */
  933. #define xdr_sreal xdr_float
  934.  
  935. #ifndef NW2tm /* conflict with cstools/build.h */
  936. typedef char    TEXT;   /* text string */
  937. #endif
  938.  
  939. #define VOID    void
  940. #define FAST    register  /* fast definitions */
  941.  
  942. #define NORMTERM  0 /* Normal exit condition */
  943. #define ERRTERM   1 /*  error exit condition */
  944.  
  945. #define LOCAL   static    /* local variables */
  946.  
  947. /* EXPORTs and IMPORTs */
  948.  
  949. #define IMPORT  extern    /* external (proc) reference */
  950. #define EXPORT        /* declare an external (proc) */
  951.  
  952. #if defined(VMS)
  953. #define GLOBALREF globalref /* external (data) reference */
  954. #define GLOBALDEF    globaldef /* declare an external (datum) */
  955. #else
  956. #define GLOBALREF extern
  957. #define GLOBALDEF
  958. #endif
  959.  
  960. #define ASof(x)   (sizeof((x))/sizeof(x[0]))
  961.  
  962. /*
  963.  * -----------------------------------------------------------------------
  964.  * SEC 5. definitions which vary depending upon compiler or platform
  965.  * -----------------------------------------------------------------------
  966.  */
  967.  
  968. #ifdef SUN
  969. typedef char  MVOID;
  970. #else
  971. #define MVOID   void
  972. #endif
  973.  
  974. #ifdef MAC
  975. typedef short bool;
  976. #else
  977. typedef int bool;
  978. #endif
  979.  
  980. #ifdef INT_EQ_SHORT
  981. #define MAXINT  0x7FFF
  982. #define MININT  0x8000
  983. #define INT_16  int
  984. #define INT_32  long
  985. #define xdr_int32 xdr_long
  986. #endif
  987.  
  988. #ifdef INT_EQ_LONG
  989. #define MAXINT  0x7FFFFFFF
  990. #define MININT  0x80000000
  991. #define INT_16  short
  992. #define INT_32  int
  993. #define xdr_int32 xdr_int
  994. #endif
  995.  
  996. #ifdef SIZEOF_MACRO_OK
  997.  
  998. #define SIZEOFINT sizeof(int)
  999. #define SIZEOFLONG  sizeof(long)
  1000.  
  1001. #else /* preprocessor chokes on sizeof(int) in a MACRO */
  1002.  
  1003. #define SIZEOFSHORT 2 
  1004. #define SIZEOFLONG  4
  1005.  
  1006. #ifdef INT_EQ_LONG
  1007. #define SIZEOFINT SIZEOFLONG
  1008. #else
  1009. #define SIZEOFINT SIZEOFSHORT
  1010. #endif /* not INT_EQ_LONG */
  1011.  
  1012. #endif /* not SIZEOF_MACRO_OK */
  1013.  
  1014. #define NRZRO         (.000001) /* close enough to zero */
  1015.  
  1016. #ifdef MSDOS
  1017. #define FNLEN 8     /* max length for a file name */
  1018. #define FN_DISP_LEN FNLEN               /* The display portion of file */
  1019. #define FNXLEN  12      /* extended length */
  1020. #endif /* MSDOS */
  1021.  
  1022. #if defined(UNIX)
  1023. #define FNLEN 40      /* max length for a file name */
  1024. #define FN_DISP_LEN 8                   /* The display portion of file */
  1025. #define FNXLEN  120     /* extended length */
  1026. #endif /* SUN */
  1027.  
  1028. #ifdef MAC
  1029. #define FNLEN 27      /* max length for a file name */
  1030. #define FN_DISP_LEN 8           /* The display portion of file */
  1031. #define FNXLEN  31      /* extended length */
  1032. #endif /* MAC */
  1033.  
  1034. #define ALIGN(x,a)  (((x)+(a-1))&(-(a)))  /* alignment macro */
  1035.  
  1036. #define L4A(x)  ALIGN(x,4)      /* 4-byte alignment */
  1037.  
  1038. #define FNALC L4A(FNLEN+1)      /* space to allocate */
  1039. #define FNXALC  L4A(FNXLEN+1)   /* space to allocate */
  1040.  
  1041. /* remove unused macros */
  1042.  
  1043. #undef INT_EQ_LONG
  1044. #undef INT_EQ_SHORT
  1045.  
  1046. /* A story: ( TM, 1/23/91 )
  1047.    According to the Harbison-Steele reference, ANSI C permits void 
  1048.    in a function prototype, but not in a function definition, to 
  1049.    indicate that the function accepts no arguments. 
  1050.  
  1051.    Some compilers, otherwise ANSI compliant, require that the definition
  1052.    use "void" to match the prototype. To solve this sticky problem, 
  1053.    use NO_ARGS in function definitions only.
  1054. */
  1055.  
  1056. #if defined(__TRANSPUTER__) || defined(M_I86) || defined(RS6) || defined(PS2AIX)
  1057. #define NO_ARGS void
  1058. #else
  1059. #define NO_ARGS
  1060. #endif
  1061.  
  1062. /* Older Unix machines use varargs.h to support a portable method for
  1063.    handling multiple arguments. Newer compilers supply ANSI standard
  1064.    stdarg.h */
  1065.  
  1066. #undef USE_VARARGS
  1067. #if defined(SUN) || defined(EWS) || defined(CRAY) || defined(IRIS)
  1068. /* force VARARGS */
  1069. #define USE_VARARGS 1
  1070. #endif
  1071.  
  1072. #ifdef USE_VARARGS
  1073. #include <varargs.h>
  1074. #define VA_START(argp, last_arg) va_start(argp)
  1075. #define VA_ALIST ,va_alist
  1076. #else
  1077. #include <stdarg.h>
  1078. #define VA_START(argp, last_arg) va_start(argp, last_arg)
  1079. #define va_dcl
  1080. #define VA_ALIST
  1081. #endif
  1082.  
  1083. #if defined(unix) && !defined(I860) && !defined(EWS) && !defined(CRAY) && !defined(IRIS) && !defined(SOLARIS)
  1084. #define BSDUNIX 1
  1085. #endif
  1086.  
  1087. #ifndef DP_RUN
  1088. #ifdef DGXWIN
  1089. /* the TEMP_UNIX kludge is attempt to fix problem with a duplicate use
  1090.    of UNIX under VMS systems */ 
  1091. #ifdef UNIX
  1092. #define TEMP_UNIX 1
  1093. #undef UNIX
  1094. #endif
  1095. #include <X11/Intrinsic.h>
  1096. #include <X11/keysym.h>
  1097. #if defined(VMS)
  1098. #include <X11/DwtAppl.h>    /* major VMS grab; --AWP, 8-May-91 */
  1099. #endif
  1100. #ifdef TEMP_UNIX
  1101. #define UNIX 1
  1102. #undef TEMP_UNIX
  1103. #endif
  1104. #define FLIP_Y( value ) ((dg_displaybox[3] - (value)))
  1105. typedef Widget  windowhandle_t;
  1106. #endif /* DGXWIN */
  1107. #endif /* not DPTEST */
  1108.  
  1109. /* MSDOS compiler support for far pointers */
  1110.  
  1111. #if defined(__ZTC__)
  1112. #define ZFAR far
  1113. #define FAR far
  1114. #else
  1115. #define ZFAR
  1116. #if defined(_MSC_VER)
  1117. #define FAR _far
  1118. #else
  1119. #if defined(__TURBOC__)
  1120. #define FAR far
  1121. #else
  1122. #define FAR
  1123. #endif /* __TURBOC__ */
  1124. #endif /* _MSC_VER  */
  1125. #endif /* __ZTC__ */
  1126.  
  1127. #define VOIDF VOID ZFAR
  1128.  
  1129. /* some compilers require (VOID *) cast */
  1130.  
  1131. #if defined(SUN) || defined(XTM) || defined(TRANS_PHYS) || defined(VAXULT) || defined(VMS)
  1132. #define    VP    (VOID *)    /* may cast vars as "(void*)ptr" */
  1133. #else
  1134. #define    VP
  1135. #endif
  1136.  
  1137. /* process control, initiation and termination */
  1138.  
  1139. #ifndef XTM
  1140. #define USAGE_STRC      1       /* Usage structure passed to wait4 function */
  1141. #endif
  1142.  
  1143. /* Note: SUNOS_4 has a wait4( ); following are redefinitions for other
  1144.    systems to improve readability */
  1145.  
  1146. #if defined(RS6) || defined(SYSV) || defined(PS2AIX)
  1147. #define wait4(pid,sp,opt,use) waitpid(pid,sp,opt)
  1148. #undef  USAGE_STRC
  1149. #else
  1150. #if defined(SUNOS_3) || defined(NEXT) || defined(VAXULT) || defined(VMS)
  1151. #define wait4(pid,sp,opt,use) wait3(sp,opt,use)
  1152. #endif
  1153. #endif
  1154.  
  1155. #if defined(RS6) || defined(NEXT) || defined(SYSV) || defined(PS2AIX)
  1156. #define vfork fork
  1157. #endif
  1158.  
  1159. /*
  1160.  * Inclusions (INCxxxxx)
  1161.  */
  1162.  
  1163. /* --- strings.h or alternates --- */
  1164.  
  1165. #if defined(BSDUNIX) && !defined(SKY) && !defined(VMS)    /* INCSTRINGS */
  1166. #define INCSTRINGS            /* use <strings.h> (else <string.h>) */
  1167. #endif                    /* note: VMS requires <string.h> */
  1168.  
  1169. /* --- sys/types.h or alternates --- */
  1170.  
  1171. #if (defined(UNIX) && !defined(VMS)) || defined(MSC) || defined(__ZTC__) || defined(IBP) || defined(__TURBOC__) || defined(SKY)
  1172. /* define INCSYSTYPES */
  1173. #define INCSYSTYPES            /* use <sys/types.h> (most common) */
  1174. #else 
  1175. #if defined(M860)
  1176. /* define INCMYRIADTYPES */
  1177. #define INCMYRIADTYPES            /* use <myriad.h>, not <sys/types> */
  1178. #else
  1179. #if !defined(THINK_C)            /* (use nothing) */
  1180. /* define INCTYPES */
  1181. #define INCTYPES            /* fallthru: use <types.h> */
  1182. #endif
  1183. #endif
  1184. #endif /* types.h */
  1185.  
  1186. /* --- sys/file.h or alternates --- */
  1187.  
  1188. #if !defined(VAXULT) && !defined(MSDOS)    && !defined(VMS)
  1189. /* dg: BSDUNIX. NEXT? RS6? XTM? ... */
  1190. #define INCSYSFILE            /* INCSYSFILE */
  1191. #else                    /* use <sys/file.h> (most common) */
  1192. #define INCFILE
  1193. #endif                    /* else use <file.h> */
  1194.  
  1195. /* --- sys/vm.h or alternates --- */
  1196.  
  1197. #if defined(VAXULT) || defined(EWS) || defined(VMS) || defined(IRIS) || defined (SOLARIS)
  1198. #define INCSYSVM            /* use <sys/vm.h> */
  1199. #else
  1200. #define INCVM                /* else use <vm.h> */
  1201. #endif
  1202.  
  1203. /*
  1204.  * External References (EXTxxxxx)
  1205.  */
  1206.  
  1207. /* EXTMEMMOVE ------------------------- */
  1208. #if defined(BSDUNIX) && !defined(VAXULT) && !defined(VMS)
  1209. #define EXTMEMMOVE            /* extern memmove() */
  1210. #endif
  1211.  
  1212. /* EXTSTDERR ------------------------- */
  1213. /* seems to be everyone but MS-DOS */
  1214. #if defined(MAC) || defined(UNIX) || defined(NEXT) || defined(IBP) || defined(I860)
  1215. #define EXTSTDERR 1            /* use "stderr" else "stdprn" */
  1216. #endif
  1217.  
  1218. /*
  1219.  * Signal handling function pointer
  1220.  */
  1221. #if defined(UNIX)
  1222. #ifdef BSDUNIX
  1223. typedef int  (*SIG_FUNC_PTR) ();
  1224. #else
  1225. typedef void (*SIG_FUNC_PTR) ();
  1226. #endif
  1227. #endif
  1228.  
  1229. /*
  1230.  * Macro Activiation (MACxxxxx)
  1231.  */
  1232.  
  1233. /* ( CPP can't handle arithmetic - see nw2/n2menu.c ) */
  1234. #if defined(UNIX)
  1235. #define MACNOARITH
  1236. #endif
  1237.  
  1238. /*
  1239.  * Code Segment Activiation (SRCxxxxx)
  1240.  */
  1241.  
  1242. #if !defined(VMS) && !defined(VAXULT)
  1243. #define SRCCASTLONG            /* SRCCASTLONG */
  1244. #endif                    /* supports: "*(long*)(ch) = -1" */
  1245.  
  1246. #if defined(MSDOS) && !defined(IBP)
  1247. #define SRCVM                /* SRCVM */
  1248. #endif                    /* enable body of "src/tk/if/vm.c" */
  1249.  
  1250. /*
  1251.  * Function and Procedure Activiation (FUNxxxxx)
  1252.  */
  1253.  
  1254. /* String Duplication */
  1255.  
  1256. #if defined(RS6) || defined(PS2AIX)
  1257. #define ZREFSTRDUP 1
  1258. #endif
  1259.  
  1260. #if defined(MAC) || defined(XTM) || defined(VAXULT) || defined(VMS) || defined(SKY)
  1261. #define FUNSTRDUP 1
  1262. #endif
  1263.  
  1264. #if defined(FUNSTRDUP) || defined(ZDEFSTRING)
  1265. char *strdup ARGLIST(( char * )); /* this is supposed to be in string.h but it's not */
  1266. #endif
  1267.  
  1268. /*
  1269.  .
  1270.  ....... empty for now .......
  1271.  .
  1272. */
  1273.  
  1274. /*
  1275.  * General (Misc) Use (USExxxxx)
  1276.  */
  1277.  
  1278. /* ------------------------------------ */
  1279.  
  1280. /* ANY other wierdnesses looking for a home... */
  1281.  
  1282. #endif /* HOST_H */
  1283.